<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:include page="/WEB-INF/jsp/lib.jsp" />
<table id="dg"></table>
<script type="text/javascript">
//页面加载完毕初始化表格
$(function(){
	
	//{"id":1,"deptName":null,"updateTime":null,"createTime":null,"comment":null},
	$("#dg").datagrid({
		url:'${pageContext.request.contextPath}/dept/list.do',
		columns:[[
		         {field:'id',title:'部门id',width:100},    
		         {field:'deptName',title:'部门名称',width:100},  
		         {field:'createTime',title:'创建时间',width:100,formatter:function(value){
		        	 if(value){
		        		 var date = new Date(value);
			        	 //获取区年
			        	 var year = date.getFullYear();
			        	 var month = date.getMonth()+1;
			        	 var date1 = date.getDate();
			        	 var hours = date.getHours();
			        	 var min = date.getMinutes();
			        	 var sec = date.getSeconds();
			        	 var d = year+"/"+month+"/"+date1+" "+hours+":"+min+":"+sec;
			        	 return d;
		        	 }
		        	 
		         }},    
		         {field:'updateTime',title:'修改时间',width:100},    
		         {field:'comment',title:'备注',width:100} 
		         ]],
		         fitColumns:true
	})
	
	
})
</script>